﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Shops.aspx.cs" Inherits="ShoppingApp.Shops" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" 
        AutoGenerateColumns="False" AllowSorting="True" AllowPaging="True" 
        onrowcommand="GridView1_RowCommand" onrowcreated="GridView1_RowCreated" 
        onrowdatabound="GridView1_RowDataBound"  >
    <%-- AutoGenerateColumns set to true automatically create bound fields for each field in datasource --%>
        <Columns>
            <asp:CommandField ShowSelectButton="true" ShowEditButton="true" />
            <asp:BoundField DataField="Name" HeaderText="Nazwa" SortExpression="Name"/>
            <asp:BoundField DataField="ChainName" HeaderText="Sieć handlowa" SortExpression="ChainName" />
            <asp:ButtonField Text="Edytuj" ControlStyle-BackColor="AliceBlue" ControlStyle-BorderStyle="Solid"
                ButtonType="Button" CommandName="Add" />
            <asp:HyperLinkField Text="Przejdz do strony głównej" NavigateUrl="~/Default.aspx" />
                
        </Columns>
        <HeaderStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="true" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource>
    <asp:Button ID="LoadButton" runat="server" Text="Load Data Into GridView" 
        onclick="LoadButton_Click"/>
</asp:Content>
